﻿@model Product
@section ToolBar{}
<div class="l-m-form">
    <form mark="LedinghuoForm" action="@Url.Action("Edit")" method="POST">
        @Html.Hidden("ProductId", Model.ProductId)
        @Html.LEditorFor(m => m.ProductNo, Html.TextBoxFor, false)
        @Html.LEditorFor(m => m.ProductName, Html.TextBoxFor, false)
        <div class="form-item inline-block">
            <div class="label c5">商品类别</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("CategoryBox", (Model.Category != null) ? Model.Category.CategoryName : "", "CategoryId", "text", new { data = Model.CategoryId, @readonly = "readonly", @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" }, new { req = new { message = "商品类别不允许空" } }, null)
            </div>
        </div>
        <div class="form-item inline-block">
            <div class="label c5">商品品牌</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("BrandName", Model.BrandName, new { data = Model.BrandName, @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox", fa = "fa-angle-down" },new { req = new { message = "商品品牌不允许空" } }, null)
            </div>
        </div>
        @Html.LFileUploadFor("Images", Model.Image60,"商品图片", new { filetype = "jpg,gif,jpg,png", uploadtype = "2", action = Url.Action("UploadImages", "Common"), path = "Upload/", label = "上传", ischangeupload = "1" },null, null)
        @Html.LEditorFor(m => m.Barcode, Html.TextBoxFor,false)
        @Html.LEditorFor(m => m.Price, Html.TextBoxFor,false)
        @Html.LEditorFor(m => m.MinQuantity, Html.TextBoxFor, false)
        @Html.LEditorFor(m => m.Unit, Html.TextBoxFor, new { @class="commonbox", @readonly = "readonly",fa = "fa-angle-down" }, false)
        @Html.LEditorFor(m => m.PackageCount, Html.TextBoxFor, false)
        @Html.LEditorFor(m => m.ShelfLife, Html.TextBoxFor, false)
        <div class="form-item inline-block">
            <div class="label c5">保质期单位</div>
            <div class="req">*</div>
            <div class="content">
                @Html.LTextEdit("ShelfLifeUnitBox", Model.ShelfLifeUnitId.GetEnumDescription(), "ShelfLifeUnitId", "text", new { data = Model.ShelfLifeUnitId, @class = "inp-text bc1 bgc0 inp-lg7 inp-hg6 commonbox",@readonly= "readonly", fa = "fa-angle-down" }, new { req = new { message = "保质期单位不允许空" } }, null)
            </div>
        </div>
        @Html.LEditorFor(m => m.Spec, Html.TextBoxFor)
        @Html.LEditorFor(m => m.IsImported, Html.CheckBoxFor, new { @class = "inp-checkbox" })
        @Html.LEditorFor(m => m.IsActive, Html.CheckBoxFor, new { @class = "inp-checkbox" })
        @Html.LEditorFor(m => m.IsPromotion, Html.CheckBoxFor, new { @class = "inp-checkbox" })
        @Html.LEditorFor(m=>m.Description,Html.TextAreaFor,new { rows = "10",cols = "180" })
        @Html.LEditorFor(m => m.Remark, Html.TextAreaFor, false)
        @Html.LButton("保存")
    </form>
    @Html.LPageError()
</div>
<script type="text/javascript">
    $(function () {

        //商品类别下拉列表
        $("#CategoryBox").category(function ($this) {
            $("#CategoryId").val($this.attr("data"));
        });
        
        //商品品牌下拉列表
        $("#BrandName").brand();

        //计量单位下拉列表
        $("#Unit").unit();

        //保质期单位下拉列表
        $("#ShelfLifeUnitBox").shelfLifeUnit(function ($this) {
            $("#ShelfLifeUnitId").val($this.attr("data"));
        });

        //设置富文本编辑器
        CKEDITOR.replace('Description');
    });
</script>